<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="/js/jquery-3.4.1.min.js"></script>
<style>
    tr{border-bottom: black solid 1px;}
    td{width: 200px;}
    table{border: black solid 1px;text-align: center;}
</style>
<%
    String id = request.getParameter("id");
%>

<body>
<h4>简历信息</h4>
<input type="hidden" name="id" id="id" value="<%
    out.print(id);
%>
">
<table>
    <tbody>
    <tr>
        <td>姓名</td>
        <td><input type="text" name="name" id="name" value="${resume.name}"></td>
    </tr>
    <tr>
        <td>手机号</td>
        <td><input type="text" name="phone" id="phone" value="${resume.phone}"></td>
    </tr>
    <tr>
        <td>地址</td>
        <td> <input type="text" name="address" id="address" value="${resume.address}"></td>
    </tr>
    <tr align="center">
        <td colspan="2"><button id="submit">提交</button>
            <button id="ret">返回</button></td>
    </tr>
    </tbody>
</table>
<%--姓名:<input type="text" name="name" id="name" value="${resume.name}"><br>
手机号:<input type="text" name="phone" id="phone" value="${resume.phone}"><br>
地址:<input type="text" name="address" id="address" value="${resume.address}"><br>
<button id="submit">提交</button>--%>
<script>
    $(function () {
        $("#ret").bind("click", function () {window.location.href = '/resume/showResume';})
        $("#submit").bind("click", function () {
            $.ajax({
                url: '/resume/updateResume',
                type: 'POST',
                data: {
                    "id": $("#id").val(),
                    "name": $("#name").val(),
                    "phone": $("#phone").val(),
                    "address": $("#address").val(),
                },
                success: function () {
                    window.location.href = '/resume/showResume';
                }
            });
        });
    });

</script>
</body>
</html>
